package ${basePackage}.application.${moduleName}.transform;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 代码生成器自动生成
 * Date:${.now}
 * @author
 */
public class ${className}VOTransform extends Transform implements Serializable{

    public ${className}VO transform(${className} entity) {
        return super.transform(entity, ${className}VO.class);
    }

    public ${className} transform(${className}VO vo) {
        return super.transform(vo, ${className}.class);
    }

    public List<${className}VO> transformEntityList(List<${className}> entityList) {
        return super.transformList(entityList, ${className}VO.class);
    }

    /*
    public List<SysOrgan> transformVoList(List<SysOrganVO> voList) {
        return super.transformList(voList, SysOrgan.class);
    }

    public static ${className}VO transform(${className} entity){
        if (null == entity) {
            return null;
        }
        ${className}VO vo = new ${className}VO() ;
        <#list fields as field>
        /** ${field.remarks}*/
        vo.set${field.fieldNameUP}(entity.get${field.fieldNameUP}());
        </#list>
        /** 创建时间 */
        vo.setCreateDate(entity.getCreateDate());
        /** 更新时间 */
        vo.setUpdateDate(entity.getUpdateDate());
        return vo ;
    }

    public static List<${className}VO> transformEntityList(List<${className}> entityList){
        List<${className}VO> voList = null ;
        if(null != entityList){
            voList = new ArrayList<>(entityList.size()) ;
            for(${className} entity : entityList){
                ${className}VO vo = ${className}VOTransform.transform(entity) ;
                if(null == vo){
                    continue;
                }
                voList.add(vo);
            }
        }
        return voList ;
    }

    public static ${className} transform(${className}VO vo){
        if (null == vo) {
            return null;
        }
        ${className} entity = new ${className}() ;
        <#list fields as field>
        /** ${field.remarks}*/
        entity.set${field.fieldNameUP}(vo.get${field.fieldNameUP}());
        </#list>
        /** 创建时间 */
        entity.setCreateDate(vo.getCreateDate());
        /** 更新时间 */
        entity.setUpdateDate(vo.getUpdateDate());
        return entity ;
    }

    public static List<${className}> transformVoList(List<${className}VO> voList){
        List<${className}> entityList = null ;
        if(null != voList){
            entityList = new ArrayList<>(voList.size()) ;
            for(${className}VO vo : voList){
                ${className} entity = ${className}VOTransform.transform(vo);
                if(null == entity){
                    continue;
                }
                entityList.add(entity);
            }
        }
        return entityList ;
    }
    */

}